<?php

namespace Yolo\Utils;

class DateTime
{

    /**
     * Get current date and time with milliseconds
     * @return string
     */
    public static function getCurrentDateTimeWithMs(): string
    {
        $microTime = microtime(true);

        $msec = round(($microTime - floor($microTime)) * 1000);

        return date('Y-m-d H:i:s', floor($microTime)) . '.' . str_pad($msec, 3, '0', STR_PAD_LEFT);
    }
}
